'use strict';


function getBolgList(keyword) {
    return new Promise(function (resolve,reject) {
        $.get(`${baseUrl}/bolg?keyword=` +keyword,data=>{

            resolve(data);
        })
    })
}


function getBolgById(id) {
    return new Promise(function (resolve,reject) {
            $.get(`${baseUrl}/bolg/${id}`, data => {

                resolve(data);
        })
    })   
}


function postBolg(obj) {
    return new Promise(function (resolve,reject) {
        $.post(`${baseUrl}/bolg`,obj,data =>{

            resolve(data);
        })
    })
}


function putBolg(id,obj) {
    return new Promise(function (resolve,reject) {
        $.ajax({

            url:`${baseUrl}/bolg/${id}`,
            type:'put',
            data:obj,
            success:data=>{

                resolve(data)
            }
        })
    })
}


function delBolgById(id) {
    return new Promise(function (resolve,reject) {
        $.ajax({

            url:`${baseUrl}/bolg/${id}`,
            type:'delete',
            success:data =>{

                resolve(data);
            }
        })
    })
}